<!-- 逻辑 -->
<script setup lang="ts">
const arr = ['西蓝花', '西葫芦', '西瓜']
const cat = {
  name: '布偶猫',
  foods: ['西蓝花'],
  age: 10,
  bark() {
    console.log('喵呜')
    alert('嗷呜')
    return '猫毛'
  }
}
</script>

<!-- 结构 -->
<template>
  <!-- {{插值表达式}} -->
  <h2>{{ arr[2] }}</h2>
  <h3>{{ cat.bark() }}</h3>
  <h4>{{ cat.age >= 10 ? '老猫' : '小猫' }}</h4>
  <button @click="cat.bark">喵喵叫</button>
</template>

<!-- 样式 -->
<style scoped></style>
